package com.dinpay.plugin.d;

import java.io.DataOutputStream;
import java.io.InputStream;
import java.net.URL;
import java.net.URLEncoder;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.apache.http.conn.ssl.SSLSocketFactory;

public final class d
{
  public static InputStream a(String paramString1, Map paramMap, String paramString2)
  {
    StringBuffer localStringBuffer = new StringBuffer();
    Iterator localIterator = paramMap.entrySet().iterator();
    while (localIterator.hasNext())
    {
      Map.Entry localEntry = (Map.Entry)localIterator.next();
      localStringBuffer.append((String)localEntry.getKey()).append("=").append(URLEncoder.encode((String)localEntry.getValue(), paramString2));
      localStringBuffer.append("&");
    }
    String str = localStringBuffer.deleteCharAt(-1 + localStringBuffer.length()).toString();
    SSLContext localSSLContext = SSLContext.getInstance("SSL");
    TrustManager[] arrayOfTrustManager = new TrustManager[1];
    arrayOfTrustManager[0] = new a();
    localSSLContext.init(null, arrayOfTrustManager, new SecureRandom());
    HttpsURLConnection localHttpsURLConnection = (HttpsURLConnection)new URL(paramString1).openConnection();
    localHttpsURLConnection.setSSLSocketFactory(localSSLContext.getSocketFactory());
    localHttpsURLConnection.setHostnameVerifier(SSLSocketFactory.STRICT_HOSTNAME_VERIFIER);
    localHttpsURLConnection.setDoOutput(true);
    localHttpsURLConnection.setDoInput(true);
    localHttpsURLConnection.setRequestMethod("POST");
    localHttpsURLConnection.setUseCaches(false);
    localHttpsURLConnection.setInstanceFollowRedirects(true);
    localHttpsURLConnection.setConnectTimeout(5000);
    localHttpsURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    localHttpsURLConnection.setRequestProperty("Connection", "Keep-Alive");
    localHttpsURLConnection.setRequestProperty("Charset", "UTF-8");
    DataOutputStream localDataOutputStream = new DataOutputStream(localHttpsURLConnection.getOutputStream());
    localDataOutputStream.writeBytes(str);
    localDataOutputStream.flush();
    localDataOutputStream.close();
    if (localHttpsURLConnection.getResponseCode() == 200)
      return localHttpsURLConnection.getInputStream();
    return null;
  }

  private static final class a
    implements X509TrustManager
  {
    private a(byte paramByte)
    {
    }

    public final void checkClientTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString)
    {
    }

    public final void checkServerTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString)
    {
    }

    public final X509Certificate[] getAcceptedIssuers()
    {
      return new X509Certificate[0];
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.dinpay.plugin.d.d
 * JD-Core Version:    0.6.2
 */